<?php

	eb_include_class("EbDataHolder");

	class EbSession extends EbDataHolder
	{
		public function init()
		{
			session_start(); 
			
			$this->data = &$_SESSION;
			
			if ($this->lengthData() == 0)
			{
				$this->setData("created_at",time());
				$this->setData("updated_at",time());
			}
			else
			{
				$this->setData("updated_at",time());
			}
		}
		
		public function setFlashMessage($key, $value)
		{
			$this->setData('flashmessage/'.$key,$value);
		}
		
		public function getFlashMessage($key)
		{
			return $this->getData('flashmessage/'.$key);
		}
	}